#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:p="http://primefaces.org/ui"
	template="/templates/loggedTemplate.xhtml">

	<f:metadata>
		<f:event type="preRenderView"
			listener="${symbol_pound}{livroBean.initConversation}" />
	</f:metadata>
	 
	<ui:define name="content">
		
		<h1 class="formTitle ui-widget-header ui-corner-all">${symbol_pound}{msg['livro.titulo.cadastro']}</h1>

		<h:form id="autorForm">
			
			<p:growl id="messages" />	
			
			<p:panelGrid columns="2" id="panel">
			
				${symbol_pound}{msg['livro.titulo']}
				<p:inputText value="${symbol_pound}{livroBean.entidade.titulo}" id="titulo" label="${symbol_pound}{msg['livro.titulo']}" />
			
				${symbol_pound}{msg['livro.isbn']}
				<p:inputText value="${symbol_pound}{livroBean.entidade.isbn}" id="isbn" label="${symbol_pound}{msg['livro.isbn']}" />
			
				${symbol_pound}{msg['livro.autores']}
				<p:pickList id="autores" value="${symbol_pound}{livroBean.autores}" var="autor"   
                	itemLabel="${symbol_pound}{autor.nome}" itemValue="${symbol_pound}{autor}">
                	<f:converter converterId="pickListEntityConverter" />
                </p:pickList>

			</p:panelGrid>
			
			<div id="buttons" class="ui-widget ui-widget-header">
				<p:commandButton value="${symbol_pound}{msg['botao.salvar']}" action="${symbol_pound}{livroBean.salvar}" update="livroForm" ajax="false" />
				<p:commandButton value="${symbol_pound}{msg['botao.cancelar']}" action="${symbol_pound}{livroBean.cancelar}" immediate="true" />			
			</div>
			
		</h:form>
	</ui:define>
</ui:composition>
